IF OBJECT_ID('ssf.regex_matches') IS NOT NULL
	DROP FUNCTION [ssf].[regex_matches];
GO

CREATE FUNCTION [ssf].[regex_matches](
	@input NVARCHAR(MAX)
	, @pattern NVARCHAR(MAX)
)
RETURNS TABLE (
	match_sequence INT
	, match_index INT
	, match_value NVARCHAR(MAX)
	, group_sequence INT
	, group_index INT
	, group_value NVARCHAR(MAX)
	, capture_sequence INT
	, capture_index INT
	, capture_value NVARCHAR(MAX)
)
AS
EXTERNAL NAME [UtilityRegex].[SQLServerFramework.UtilityRegex].[RegexMatches]
GO
